<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>

<script type="text/javascript" src="js/jquery.min.js"></script>
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="css/bootstrap.css">

<style type="text/css">

    #btn-out {
        background-color: whitesmoke;
        height: 500px;
        margin: auto;
        text-align: center;
    }

    .btn {
        height: 200px;
        width: 400px;
        font-size: 30px;

        line-height: 200px;
        margin: 20px;
    }
</style>
<body>

<c:if test="${! empty msg }">
    <script type="text/javascript">

        alert("${msg}");

    </script>

    <!-- 使用完记得清除，避免影响其他页面 -->
    <c:remove var="msg" scope="session"/>
</c:if>

<nav class="navbar navbar-default">
    <div>
        <ul class="nav navbar-nav">
            <li>
                <a><b>快递派发</b></a>
            </li>
            <li>
                <a>${phone }</a>
            </li>
            <li>
                <a href="index.jsp">
                    首页
                </a>
            </li>

            <li>
                <a id="time1"></a>
            </li>

        </ul>
    </div>
</nav>

<div id="btn-out">
    <a href="userRegister.jsp">
        <div class="btn btn-primary">注册</div>
    </a>

    <c:if test="${empty phone}">
    <a href="userLogin.jsp">
        <div class="btn btn-primary">登录</div>
    </a></c:if>

    <c:if test="${not empty phone}">
    <a href="userLogin.jsp">
        <div class="btn btn-primary">退出</div>
    </a>
    </c:if>

    <a href="queryUserPhone1.do?phone=${phone}">
        <div class="btn btn-primary">我要寄件</div>
    </a>

    <a href="queryUserPhone.do?phone=${phone}">
        <div class="btn btn-primary">个人信息</div>
    </a>

    <a href="showAllAppointByPhonePage.do?phone=${phone}&pageNum=1&pageSize=3">
        <div class="btn btn-primary">全部订单</div>
    </a>

    <a href="queryUserPhone2.do">
        <div class="btn btn-primary">寄多个件</div>
    </a>
</body>
</html>

<script>
    function showTime() {
        var now = new Date();
        return now.toLocaleString();
    }

    setInterval(function () {
        var d = showTime();
        $("#time1").html(d);
    }, 1000);
</script>